package com.coolingme.hutool;

import cn.hutool.aop.ProxyUtil;

/**
 * 使用Hutool实现Cglib动态代理
 *
 * @author wangyue
 * @date 2022/8/9 20:32
 */
public class Test {

    public static void main(String[] args) {
        RichMan richMan = ProxyUtil.proxy(new RichMan(), MatchAspect.class);
        richMan.findLove();

        String name = richMan.getName(5);
        System.out.println("name = " + name);

//        HonestMan honestMan = ProxyUtil.proxy(new HonestMan(), MatchAspect.class);
//        honestMan.findLove();
//
//        PoolMan poolMan = ProxyUtil.proxy(new PoolMan(), MatchAspect.class);
//        poolMan.findLove();

    }

}
